//
//  CTImer.m
//  jumpingfrog
//
//  Created by Tri Vo on 8/28/13.
//  Copyright (c) 2013 Tri Vo. All rights reserved.
//

#import "CTImer.h"

@implementation CTImer

- (id)init {
    if (self = [super init]) {
        m_timePassed = 0;
        m_timeSeconds = 0;
    }
    return self;
}

- (void)increaseTime:(CGFloat)time {
    m_timePassed += time;
    int hour = m_timePassed/3600;
    int minute = (m_timePassed/60) - (hour*60);
    m_timeSeconds = m_timePassed - (hour*3600) - (minute*60);
}

- (void)decreaseTime:(CGFloat)time {
    m_timePassed -= time;
    int hour = m_timePassed/3600;
    int minute = (m_timePassed/60) - (hour*60);
    m_timeSeconds = m_timePassed - (hour*3600) - (minute*60);
}

- (int)getSecondsPassed {
    return m_timeSeconds;
}

- (void)setTime:(CGFloat)time {
    m_timePassed = time;
}

- (void)dealloc {
    [super dealloc];
}
@end
